package io.renren.modules.car.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.car.dao.CarShopDao;
import io.renren.modules.car.entity.CarShopEntity;
import io.renren.modules.car.service.CarShopService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service("carShopService")
public class CarShopServiceImpl extends ServiceImpl<CarShopDao, CarShopEntity> implements CarShopService {

    @Resource
    private CarShopDao carShopDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CarShopEntity> page = this.page(
                new Query<CarShopEntity>().getPage(params),
                new QueryWrapper<CarShopEntity>().eq("create_user",params.get("create_user"))
        );

        return new PageUtils(page);
    }

    @Override
    public List<CarShopEntity> queryList(Map<String, Object> params) {

        return carShopDao.queryList(params);
    }
}
